home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
gfx
/
edit
/
button.lha
/
button.ifx
next >
Wrap
Text File
|
1998-02-01
|
5KB
|
251 lines
/*
* $VER: button 0.8
* by Carl Licke / Turbid design
* mailto:carl.licke@swipnet.se
* http://home2.swipnet.se/~w-24653/
*
* Arexx script for ImageFX
*/
OPTIONS RESULTS
gauss =GETCLIP('button_gauss')
contr =GETCLIP('button_contr')
shade =GETCLIP('button_shade')
mgik =GETCLIP('button_mgik')
aalias =GETCLIP('button_aalias')
bgswap =GETCLIP('button_bgswap')
bgcol =GETCLIP('button_bgcol')
neg =GETCLIP('button_neg')
corr =GETCLIP('button_corr')
/* ------ here you may change the defaults ------ */
IF gauss='' THEN gauss=2
IF contr='' THEN contr=0
IF shade='' THEN shade=50
IF mgik='' THEN mgik=0
IF aalias='' THEN aalias=0
IF bgswap='' THEN bswap=0
IF bgcol='' THEN bgcol=0
IF neg='' THEN neg=0
IF corr='' THEN corr=1
Gadget.1 = 'I/140/18/smoothness (0-5)/'gauss
Gadget.2 = 'I/140/35/contr. (-127 - 127)/'contr
Gadget.3 = 'I/140/52/shade (0-100)/'shade
Gadget.4 = 'X/230/19/magic scissors/'mgik
Gadget.5 = 'X/230/36/anti alias/'aalias
Gadget.6 = 'X/230/53/background from swap/'bgswap
Gadget.7 = 'X/230/70/pick color for backg./'bgcol
Gadget.8 = 'X/15/70/pressed button/'neg
Gadget.9 = 'X/15/87/color correction/'corr
Gadget.10= 'X/230/87/save these settings/1'
ComplexRequest '"button"' 10 Gadget 430 123
IF rc ~= 0 THEN EXIT
gauss = result.1
contr = result.2
shade = result.3
mgik = result.4
aalias = result.5
bgswap = result.6
bgcol = result.7
neg = result.8
corr = result.9
saveit = result.10
ifxver=0
ADDRESS COMMAND 'list ImageFX:Matrix/GuassianLow ImageFX:Matrix/GaussianMedium ImageFX:Matrix/GuassianHigh >NIL:'
IF rc = 0 THEN ifxver=1
ADDRESS COMMAND 'list ImageFX:Storage/Convolve/GaussianLow ImageFX:Storage/Convolve/GaussianMedium ImageFX:Storage/Convolve/GaussianHigh >NIL:'
IF rc = 0 THEN ifxver=2
IF ifxver=0 THEN DO
RequestNotify 'Error! Please contact carl.licke@swipnet.se'
EXIT
END
IF saveit=1 THEN DO
CALL SETCLIP('button_gauss', gauss)
CALL SETCLIP('button_contr', contr)
CALL SETCLIP('button_shade', shade)
CALL SETCLIP('button_mgik', mgik)
CALL SETCLIP('button_aalias', aalias)
CALL SETCLIP('button_bgswap', bgswap)
CALL SETCLIP('button_bgcol', bgcol)
CALL SETCLIP('button_neg', neg)
CALL SETCLIP('button_corr', corr)
END
bgr=255
bgg=255
bgb=255
GetPalette '0'
PARSE VAR result r g b
IF bgcol=1 & bgswap=1 THEN DO
RequestNotify 'No background pick, you told me to use swap.'
bgcol=0
END
IF bgcol=1 THEN DO
ActiveColor 0
Message 'pick background color'
Pick
WaitFor SELECTUP
GetPalette '-1'
PARSE VAR result bgr bgg bgb
Message ''
END
Redraw Off
Swap
SaveBufferAs ILBM "T:buttontemp.ilbm"
Swap
ActiveColor 0
DrawMode Normal
Pen 0 1
AlphaChannel Off
EdgeMode Normal 0
Blend 100
Transparency 0 0 1
FillMode Solid 0 0 0 SMOOTH
Buffer2Swap
IF mgik=0 THEN DO
Swap
SaveUndo
Swap
END
ELSE
SaveUndo
Undo Off
GetMain
PARSE VAR result name width height depth
IF mgik=1 THEN
MagicScissors
ELSE
Scissors
Box 0 0 width height
Region Full
Scale width+24 height+24 BORDER
ClearBuffer 255 255 255 FORCE
ActiveColor 0
SetPalette '-1' 0 0 0
DrawMode Color
NewArea
AddArea (width+24)/2 (height+24)/2
FreeDraw
DrawMode Normal
SaveAlphaAs ILBM "T:buttonalphatemp.ilbm"
Buffer2Alpha
IF ifxver=1 THEN DO
IF gauss=1 THEN DO
Convolve "Matrix/GuassianLow"
END
IF gauss=2 THEN DO
Convolve "Matrix/GaussianMedium"
END
IF gauss=3 THEN DO
Convolve "Matrix/GuassianHigh"
END
IF gauss=4 THEN DO
Convolve "Matrix/GuassianHigh"
Convolve "Matrix/GuassianHigh"
END
IF gauss=5 THEN DO
Convolve "Matrix/GuassianHigh"
Convolve "Matrix/GuassianHigh"
Convolve "Matrix/GuassianHigh"
END
END
IF ifxver=2 THEN DO
IF gauss=1 THEN DO
Convolve "Storage/Convolve/GaussianLow"
END
IF gauss=2 THEN DO
Convolve "Storage/Convolve/GaussianMedium"
END
IF gauss=3 THEN DO
Convolve "Storage/Convolve/GaussianHigh"
END
IF gauss=4 THEN DO
Convolve "Storage/Convolve/GaussianHigh"
Convolve "Storage/Convolve/GaussianHigh"
END
IF gauss=5 THEN DO
Convolve "Storage/Convolve/GaussianHigh"
Convolve "Storage/Convolve/GaussianHigh"
Convolve "Storage/Convolve/GaussianHigh"
END
END
SwapAlpha
Negative
Crop 12 12 width height
SwapAlpha
Color2Grey Luma
reliefmap
IF neg=0 THEN Negative
Contrast contr
Crop 11 11 width height
Swap
Merge shade ALPHA
IF corr=1 THEN DO
Contrast shade*1.29
END
IF mgik=1 THEN DO
Swap
ClearBuffer bgr bgg bgb FORCE
IF bgswap=1 THEN DO
LoadBrush "T:buttontemp.ilbm" FORCE
FillMode Tile 0 0 0 Smooth
FloodFill 0 0 1
FillMode Solid 0 0 0 Smooth
END
Swap
MagicScissors
Box 0 0 width height
Region Full
Swap
IF aalias=1 THEN EdgeMode AntiAlias 0
NewArea
AddArea width/2 height/2
FreeDraw
EdgeMode Normal 0
END
Swap
LoadBuffer "T:buttontemp.ilbm" FORCE
Swap
ADDRESS COMMAND 'Delete "T:buttontemp.ilbm" QUIET'
KillBrush
KillAlpha
LoadAlpha "T:buttonalphatemp.ilbm" Force
ADDRESS COMMAND 'Delete "T:buttonalphatemp.ilbm" QUIET'
SetPalette 0 r g b
Redraw On
Undo On
EXIT